//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.qst.crop.entity;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.persistence.Id;
import javax.validation.constraints.Pattern;
import java.util.Date;

public class User {
    @Id
    private @Pattern(
            regexp = "^[a-zA-Z][A-Za-z0-9]{2,9}+$",
            message = "账号必须以字母开头，长度在3-10之间，只能包含英文字符、数字"
    ) String userName;
    private @Pattern(
            regexp = "^[a-zA-Z][a-zA-Z0-9_]{5,17}$",
            message = "密码必须以字母开头，长度在6-18之间，只能包含英文字符、数字和下划线"
    ) String password;
    @NotBlank(
            message = "昵称不能为空"
    )
    private String nickName;
    private String realName;
    private @Pattern(
            regexp = "^1[3|4|5|7|8][0-9]{9}$",
            message = "请输入正确的手机号"
    ) String phone;
    private @Pattern(
            regexp = "^\\d{15}|\\d{18}$",
            message = "请输入15或18位有效身份证号"
    ) String identityNum;
    @Length(
            min = 2,
            max = 30,
            message = "请输入的地址长度在2-30之间"
    )
    private String address;
    private @Pattern(
            regexp = "^(user|expert|admin)$",
            message = "设置角色请输入 user,expert,admin 等角色"
    ) String role;
    private Date createTime;
    private Date updateTime;
    private int integral;
    private int credit;
    private String avatar;

    public String getUserName() {
        return this.userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return this.password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickName() {
        return this.nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getPhone() {
        return this.phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getIdentityNum() {
        return this.identityNum;
    }

    public void setIdentityNum(String identityNum) {
        this.identityNum = identityNum;
    }

    public String getAddress() {
        return this.address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getRole() {
        return this.role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getIntegral() {
        return this.integral;
    }

    public void setIntegral(Integer integral) {
        this.integral = integral;
    }

    public Integer getCredit() {
        return this.credit;
    }

    public void setCredit(Integer credit) {
        this.credit = credit;
    }

    public String getAvatar() {
        return this.avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public User() {
    }

    public String getRealName() {
        return this.realName;
    }

    public void setRealName(final String realName) {
        this.realName = realName;
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof User)) {
            return false;
        } else {
            User other = (User)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                label167: {
                    Object this$integral = this.getIntegral();
                    Object other$integral = other.getIntegral();
                    if (this$integral == null) {
                        if (other$integral == null) {
                            break label167;
                        }
                    } else if (this$integral.equals(other$integral)) {
                        break label167;
                    }

                    return false;
                }

                Object this$credit = this.getCredit();
                Object other$credit = other.getCredit();
                if (this$credit == null) {
                    if (other$credit != null) {
                        return false;
                    }
                } else if (!this$credit.equals(other$credit)) {
                    return false;
                }

                label153: {
                    Object this$userName = this.getUserName();
                    Object other$userName = other.getUserName();
                    if (this$userName == null) {
                        if (other$userName == null) {
                            break label153;
                        }
                    } else if (this$userName.equals(other$userName)) {
                        break label153;
                    }

                    return false;
                }

                Object this$password = this.getPassword();
                Object other$password = other.getPassword();
                if (this$password == null) {
                    if (other$password != null) {
                        return false;
                    }
                } else if (!this$password.equals(other$password)) {
                    return false;
                }

                label139: {
                    Object this$nickName = this.getNickName();
                    Object other$nickName = other.getNickName();
                    if (this$nickName == null) {
                        if (other$nickName == null) {
                            break label139;
                        }
                    } else if (this$nickName.equals(other$nickName)) {
                        break label139;
                    }

                    return false;
                }

                Object this$realName = this.getRealName();
                Object other$realName = other.getRealName();
                if (this$realName == null) {
                    if (other$realName != null) {
                        return false;
                    }
                } else if (!this$realName.equals(other$realName)) {
                    return false;
                }

                label125: {
                    Object this$phone = this.getPhone();
                    Object other$phone = other.getPhone();
                    if (this$phone == null) {
                        if (other$phone == null) {
                            break label125;
                        }
                    } else if (this$phone.equals(other$phone)) {
                        break label125;
                    }

                    return false;
                }

                label118: {
                    Object this$identityNum = this.getIdentityNum();
                    Object other$identityNum = other.getIdentityNum();
                    if (this$identityNum == null) {
                        if (other$identityNum == null) {
                            break label118;
                        }
                    } else if (this$identityNum.equals(other$identityNum)) {
                        break label118;
                    }

                    return false;
                }

                Object this$address = this.getAddress();
                Object other$address = other.getAddress();
                if (this$address == null) {
                    if (other$address != null) {
                        return false;
                    }
                } else if (!this$address.equals(other$address)) {
                    return false;
                }

                label104: {
                    Object this$role = this.getRole();
                    Object other$role = other.getRole();
                    if (this$role == null) {
                        if (other$role == null) {
                            break label104;
                        }
                    } else if (this$role.equals(other$role)) {
                        break label104;
                    }

                    return false;
                }

                label97: {
                    Object this$createTime = this.getCreateTime();
                    Object other$createTime = other.getCreateTime();
                    if (this$createTime == null) {
                        if (other$createTime == null) {
                            break label97;
                        }
                    } else if (this$createTime.equals(other$createTime)) {
                        break label97;
                    }

                    return false;
                }

                Object this$updateTime = this.getUpdateTime();
                Object other$updateTime = other.getUpdateTime();
                if (this$updateTime == null) {
                    if (other$updateTime != null) {
                        return false;
                    }
                } else if (!this$updateTime.equals(other$updateTime)) {
                    return false;
                }

                Object this$avatar = this.getAvatar();
                Object other$avatar = other.getAvatar();
                if (this$avatar == null) {
                    if (other$avatar != null) {
                        return false;
                    }
                } else if (!this$avatar.equals(other$avatar)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof User;
    }

    public int hashCode() {
        boolean PRIME = true;
        int result = 1;
        Object $integral = this.getIntegral();
        result = result * 59 + ($integral == null ? 43 : $integral.hashCode());
        Object $credit = this.getCredit();
        result = result * 59 + ($credit == null ? 43 : $credit.hashCode());
        Object $userName = this.getUserName();
        result = result * 59 + ($userName == null ? 43 : $userName.hashCode());
        Object $password = this.getPassword();
        result = result * 59 + ($password == null ? 43 : $password.hashCode());
        Object $nickName = this.getNickName();
        result = result * 59 + ($nickName == null ? 43 : $nickName.hashCode());
        Object $realName = this.getRealName();
        result = result * 59 + ($realName == null ? 43 : $realName.hashCode());
        Object $phone = this.getPhone();
        result = result * 59 + ($phone == null ? 43 : $phone.hashCode());
        Object $identityNum = this.getIdentityNum();
        result = result * 59 + ($identityNum == null ? 43 : $identityNum.hashCode());
        Object $address = this.getAddress();
        result = result * 59 + ($address == null ? 43 : $address.hashCode());
        Object $role = this.getRole();
        result = result * 59 + ($role == null ? 43 : $role.hashCode());
        Object $createTime = this.getCreateTime();
        result = result * 59 + ($createTime == null ? 43 : $createTime.hashCode());
        Object $updateTime = this.getUpdateTime();
        result = result * 59 + ($updateTime == null ? 43 : $updateTime.hashCode());
        Object $avatar = this.getAvatar();
        result = result * 59 + ($avatar == null ? 43 : $avatar.hashCode());
        return result;
    }

    public String toString() {
        return "User(userName=" + this.getUserName() + ", password=" + this.getPassword() + ", nickName=" + this.getNickName() + ", realName=" + this.getRealName() + ", phone=" + this.getPhone() + ", identityNum=" + this.getIdentityNum() + ", address=" + this.getAddress() + ", role=" + this.getRole() + ", createTime=" + this.getCreateTime() + ", updateTime=" + this.getUpdateTime() + ", integral=" + this.getIntegral() + ", credit=" + this.getCredit() + ", avatar=" + this.getAvatar() + ")";
    }
}
